<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<f:view contentType="text/html" encoding="UTF-8" locale="#{localeBean.locale}" xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
        xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets"
        >
    <f:loadBundle var="msg" basename="pl.pawluk.inz.web.SpringResourceBundle"/>
    <h:head>
        <title><h:outputText value="#{msg.webTitle}"/></title>
        <link rel="stylesheet" type="text/css" href="css/style.css"/>
        <script>
            if (window.location.toString().indexOf("admin") > 0){
                window.location = "/VLP/index.xhtml";
            }
        </script>
    </h:head>
    <h:body onload="document.f.j_username.focus();">
        <h:form id="gf" prependId="true">
            <p:dialog id="growl" visible="#{not empty facesContext.messageList}" widgetVar="growlDialog" modal="true"
                      header="#{msg.error}">
                <p:messages autoUpdate="true" showDetail="true" id="messages"/>
                <f:facet name="footer">
                    <p:commandButton id="closeGrowl" value="#{msg.OK}" onclick="growlDialog.close();"/>
                </f:facet>
            </p:dialog>
        </h:form>

        <div id="main_container">
            <div id="header">
                <div class="logo"><img src="images/logo.png" border="0" alt="" title=""/></div>
            </div>

            <div class="center_content">
                <div class="title_welcome">Login with Username and Password</div>
                <form name='f' action='j_spring_security_check' method='POST'>
                    <table>
                        <tr>
                            <td>User:</td>
                            <td><input type='text' name='j_username' value=''/></td>
                        </tr>
                        <tr>
                            <td>Password:</td>
                            <td><input type='password' name='j_password'/></td>
                        </tr>
                        <tr>
                            <td><input type='checkbox' name='_spring_security_remember_me'/></td>
                            <td>Remember me on this computer.</td>
                        </tr>
                        <tr>
                            <td colspan='2'><input name="submit" type="submit" value="Login"/></td>
                        </tr>
                    </table>
                </form>
                <div class="clear"></div>
            </div>
            <ui:include src="WEB-INF/views/footer.xhtml"/>
        </div>
    </h:body>
</f:view>
</html>